﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.EquipmentManagement;

namespace Digitalmes.Model.EquipmentManagement
{
    /// <summary>
    /// 设备状态记录
    /// </summary>
	[Table("EquipmentStateRecord")]

    [Display(Name = "_Model.EquipmentStateRecord")]
    public class EquipmentStateRecord : TopBasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._EquipmentStateRecord._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._LineId")]
        [Comment("产线编号")]
        public long? LineId { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._LineName")]
        [Comment("产线名称")]
        public string LineName { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._Equipment")]
        [Comment("设备")]
        public Equipment Equipment { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._Equipment")]
        [Comment("设备")]
        public long? EquipmentId { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._EquipName")]
        [Comment("设备名称")]
        public string EquipName { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._Status")]
        [Comment("设备状态")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public EquipStatusEnum? Status { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._StartTime")]
        [Comment("开始时间")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public DateTime? StartTime { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._EndTime")]
        [Comment("结束时间")]
        public DateTime? EndTime { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._Duration")]
        [Comment("持续时长(s)")]
        [Precision(18,2)]
        public decimal? Duration { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._ProuductId")]
        [Comment("产品")]
        public long? ProuductId { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._ProductName")]
        [Comment("产品名称")]
        public string ProductName { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._ActiveOee")]
        [Comment("OEE激活")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool? ActiveOee { get; set; }
        [Display(Name = "_Model._EquipmentStateRecord._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
